Skip to content

Accept case insensitive values in boolean settings #10663

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

bernardodemarco
Copy link
Collaborator

Description

Currently, when updating boolean settings, the Management Server performs a case sensitive validation of the inserted values. Thus, only the true and false values are accepted.

This PR proposes to extend this validation to encompass case insensitive boolean values. Therefore, values such as True and FALSE will be accepted and will be properly normalized before being persisted in the database.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • build/CI
  • test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Screenshots (if appropriate):

How Has This Been Tested?

  • Verified that it was possible to update the quota.enable.service global setting to FaLsE.
updateConfiguration API execution
(acs-all-in-one) 🦌 > update configuration name="quota.enable.service" value="FaLsE"
{
  "configuration": {
    "category": "Advanced",
    "component": "QUOTA-PLUGIN",
    "defaultvalue": "false",
    "description": "Indicates whether Quota plugin is enabled or not.",
    "displaytext": "Quota enable service",
    "group": "Miscellaneous",
    "isdynamic": true,
    "name": "quota.enable.service",
    "subgroup": "Quota",
    "type": "Boolean",
    "value": "FaLsE"
  }
}
Persisted configuration value in the database
MariaDB [cloud]> select name,value from configuration where name = "quota.enable.service";
+----------------------+-------+
| name                 | value |
+----------------------+-------+
| quota.enable.service | false |
+----------------------+-------+
1 row in set (0.000 sec)
  • Verified that it was possible to update the setting value to TRUe:
updateConfiguration API execution
(acs-all-in-one) 🐓 > update configuration name="quota.enable.service" value="TRUe"
{
  "configuration": {
    "category": "Advanced",
    "component": "QUOTA-PLUGIN",
    "defaultvalue": "false",
    "description": "Indicates whether Quota plugin is enabled or not.",
    "displaytext": "Quota enable service",
    "group": "Miscellaneous",
    "isdynamic": true,
    "name": "quota.enable.service",
    "subgroup": "Quota",
    "type": "Boolean",
    "value": "TRUe"
  }
}
Persisted configuration value in the database
MariaDB [cloud]> select name,value from configuration where name = "quota.enable.service";
+----------------------+-------+
| name                 | value |
+----------------------+-------+
| quota.enable.service | true  |
+----------------------+-------+
1 row in set (0.000 sec)

@bernardodemarco
Copy link
Collaborator Author

@blueorangutan package

@bernardodemarco bernardodemarco added this to the 4.20.1 milestone Apr 4, 2025
@blueorangutan
Copy link

@bernardodemarco a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

Copy link

codecov bot commented Apr 4, 2025

Codecov Report

Attention: Patch coverage is 80.95238% with 4 lines in your changes missing coverage. Please review.

Project coverage is 16.15%. Comparing base (823080c) to head (466c76d).
Report is 11 commits behind head on 4.20.

Files with missing lines Patch % Lines
.../cloud/configuration/ConfigurationManagerImpl.java 80.95% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               4.20   #10663   +/-   ##
=========================================
  Coverage     16.14%   16.15%           
- Complexity    13253    13273   +20     
=========================================
  Files          5656     5656           
  Lines        497893   497888    -5     
  Branches      60374    60373    -1     
=========================================
+ Hits          80405    80442   +37     
+ Misses       408529   408488   -41     
+ Partials       8959     8958    -1     
Flag Coverage Δ
uitests 4.00% <ø> (ø)
unittests 17.00% <80.95%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 12955

@winterhazel winterhazel self-requested a review April 5, 2025 04:06
@bernardodemarco
Copy link
Collaborator Author

@blueorangutan package

@blueorangutan
Copy link

@bernardodemarco a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13279

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clgtm and unit tests provided. never the less I think this is such a cross cutting concern that it will need extensive testing.

@DaanHoogland
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian test result (tid-13225)
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 56037 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10663-t13225-kvm-ol8.zip
Smoke tests completed. 141 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

Copy link
Contributor

@erikbocks erikbocks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested the changes in my local environment and everything worked as expected for booleans, strings, integers, and floats.

Copy link

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

@JoaoJandre
Copy link
Contributor

@bernardodemarco could you fix the merge conflicts here?

@DaanHoogland DaanHoogland modified the milestones: 4.20.1, 4.20.2 Jun 3, 2025
@bernardodemarco bernardodemarco force-pushed the make-boolean-configs-case-insensitive branch from 12f295d to 466c76d Compare June 4, 2025 17:32
@bernardodemarco
Copy link
Collaborator Author

@bernardodemarco could you fix the merge conflicts here?

Sure, done!

@bernardodemarco
Copy link
Collaborator Author

@blueorangutan package

@bernardodemarco
Copy link
Collaborator Author

@DaanHoogland @weizhouapache @Pearl1594, can we run the CI again for this one?

@sureshanaparti
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13612

@DaanHoogland
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian test result (tid-13479)
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 54482 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10663-t13479-kvm-ol8.zip
Smoke tests completed. 141 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

@DaanHoogland DaanHoogland merged commit 8f2735a into apache:4.20 Jun 11, 2025
25 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

8 participants